<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Outstanding Logs</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="assets/css/docs.css" rel="stylesheet">
<link href="assets/css/prettyPhoto.css" rel="stylesheet" type="text/css" />
<link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
    <![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="http://www.dirtpros.com/images/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
</head>
<body data-spy="scroll" data-target=".bs-docs-sidebar" onload="getRows()">
<!-- Navbar
    ================================================== -->
<div class="nav-agency">
  <div class="navbar navbar-static-top"> 
    <!-- navbar-fixed-top -->
    <div class="navbar-inner">
      <div class="container"> 
        <a class="brand" href="index.html"> 
          <img id="LogoSmall" src="assets/img/logo.jpg" alt="Logo">
        </a>
      </div>
    </div>
  </div>
</div>
<div class="container">
  <div class="marketing">
    <!--<p>&nbsp</p>
    <p>&nbsp</p>-->

    <h2>Current Outstanding Collection Logs</h2>
    <hr noshade>
	<!--<button class="btn btn-success"><i class="icon-eye-open icon-white"></i> View</button>-->
    &nbsp;&nbsp;&nbsp;
    

    <div class="btn-toolbar" style="margin: 0;" align="left">
    <div class="btn-group">
    <button class="btn dropdown-toggle btn-large" data-toggle="dropdown">Sort By  <span class="caret"></span></button>
    <ul class="dropdown-menu">
      <li><a href="#">Date</a></li>
      <li><a href="#">Collector</a></li>
      <li><a href="#">Facility</a></li>
      <li><a href="#">Facility Type</a></li>
      <li><a href="#">Region</a></li>
      <li><a href="#">SW Removal Partner</a></li>
      <!--<li class="divider"></li>
      <li><a href="#">Separated link</a></li>-->
    </ul>
    </div>
    </div>
    &nbsp;&nbsp;&nbsp;

    <table id ="logsTable"class="table table-bordered table-hover" border="1">
    <tr>
    <th align="center">Collection Site</th>
    <th align="center">Date</th>
    <th align="center">Collector</th>
    <th align="center">Region</th>
    <th align="center">Option</th>
    </tr>
    </table>
  </div>
</div>

<!-- Le javascript
    ================================================== --> 
<!-- Placed at the end of the document so the pages load faster --> 
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> 
<script src="assets/js/jquery.js" type="text/javascript"></script> 
<script src="assets/js/google-code-prettify/prettify.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-transition.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-alert.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-modal.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-dropdown.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-scrollspy.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-tab.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-tooltip.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-popover.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-button.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-collapse.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-carousel.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-typeahead.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-affix.js" type="text/javascript"></script> 
<script src="assets/js/application.js" type="text/javascript"></script> 
<script src="assets/js/jquery.isotope.min.js" type="text/javascript"></script> 
<script src="assets/js/jquery.prettyPhoto.js" type="text/javascript"></script> 
<script src="assets/js/superfish.js" type="text/javascript"></script> 
<script src="assets/js/custom.js" type="text/javascript"></script>
<script language="javascript">

var list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

 function getRows()
 {
   var xmlhttp = new XMLHttpRequest();
  xmlhttp.onreadystatechange=function()
  {
    if (xmlhttp.readyState==4)
    {
       jsonObj = JSON.parse(xmlhttp.responseText);
	   var table = document.getElementById("logsTable");
	   
	   for (var i = 0; i<jsonObj.Logs.length; i++)
	   {
	       var row = table.insertRow(i+1);
		   row.className = "success";
		   var collectionSite = row.insertCell(0);
		   collectionSite.innerHTML = jsonObj.Logs[i].site;
		   var collectionDate = row.insertCell(1);
		   collectionDate.innerHTML = jsonObj.Logs[i].date;
		   var collector = row.insertCell(2);
		   collector.innerHTML = "AAAC";
		   var region = row.insertCell(3);
		   region.innerHTML = jsonObj.Logs[i].region;
		   var buttonRow = row.insertCell(4);
		   var button = document.createElement("button");
		   button.type = "button";
		   button.className = "btn btn-success btn-block";
		   button.innerHTML = "<i class='icon-eye-open icon-white'></i>&nbsp&nbsp;View";
		   //alert("Index = "+list[i]);
		   var curr = i;
		  // alert("curr = "+i);
		   button.onclick = function(){window.location.href = "work2.html?num="+list[curr]+""};
		   buttonRow.appendChild(button);
	   }
    }
  }
  xmlhttp.open("GET", "http://dirtprosdatabase.appspot.com/showlogs?username=aaac"+"&t="+Math.random());
  xmlhttp.send(null);
 
 }
 
/*function nextpage(){
	window.location.href = "work2.html?num="+0+"";
}*/
 </script>
</body>
</html>
